package com.howie.parnote.service.common;


import com.howie.parnote.util.Page;
import com.howie.parnote.util.PageUtil;

import java.util.List;
import java.util.Map;

/**
 * Created by HY on 2014/12/9 0009.
 */
public class ApplicationDefaultServiceImpl<T> extends AbstractService<T> {

	@Override
	public List<T> selectAll() {
		return getDao().select();
	}

	@Override
	public void insertModule(T module) {
		getDao().insert(module);
	}

	@Override
	public void insertModuleSelective(T module) {
		getDao().insertSelective(module);
	}

	@Override
	public void updateByPrimaryKeySelective(T module) {
		getDao().updateByPrimaryKeySelective(module);
	}

	@Override
	public void updateByPrimaryKey(T module) {
		getDao().updateByPrimaryKey(module);
	}

	@Override
	public T selectByPrimaryKey(Integer moduleId) {
		return (T) getDao().selectByPrimaryKey(moduleId);
	}

	@Override
	public void selectByPage(Page<T> page, Map<String, Integer> pageParams) {
		List<T> list = getDao().select(pageParams.get(PageUtil.OFFSET), pageParams.get(PageUtil.LIMIT));
		page.setResult(list);
	}




}
